const path = require('path')

export async function upload(ctx:any) {
    const file = ctx.request.files.file
    const basename = path.basename(file.path)
    return {
        url: `${ctx.origin}/uploads/${basename}`
    }
}